package gat.convertor.tg;

import com.bitsun.core.common.convertor.IConvertor;
import com.bitsun.core.common.persistence.Pager;
import gat.domain.model.tg.TopupPriceEntity;
import gat.dto.res.tg.TopupPriceResDto;
import gat.infrastructure.persistence.po.tg.TopupPricePo;
import org.mapstruct.Mapper;
/**
 * 
 * @author: yanshukeji-java
 * @email: yanshukeji-java
 */

@Mapper(componentModel="spring")
public abstract class TopupPriceResDtoConvertor implements IConvertor<TopupPriceResDto, TopupPriceEntity, TopupPricePo> {

    public  Pager<TopupPriceResDto> convertPoPager2ResDtoPager(Pager<TopupPricePo> poPager) {
        if (poPager == null) {
            return null;
        }

        Pager<TopupPriceResDto> resDtoPager = new Pager();
        resDtoPager.setTotalCount(poPager.getTotalCount());
        resDtoPager.setPageSize(poPager.getPageSize());
        resDtoPager.setTotalPage(poPager.getTotalPage());
        resDtoPager.setCurrentPage(poPager.getCurrentPage());
        resDtoPager.setList(poList2DtoList(poPager.getList()));

        return resDtoPager;
    }
}








